<?php

/* * 
 * 资讯
 */
namespace Common\Model;
use Think\Model;
class CodeModel extends BaseModel {

    public function queryForList($page=null, $map=null) {
        $list = $this->alias("c")
//            ->join("left join __CLASS__ cl on cl.class_id = fp.class_id")
            ->where(getWhereSqlByMap($map))
            ->order("c.code_id asc")
            ->limit($page->firstRow . ',' . $page->listRows)
//            ->field("fp.*, cl.class_name")
            ->select();

        return $list;

    }

    public function getListCount($map = null) {

        $count = $this->alias("c")
            //->join("left join __CATEGORY__ c on c.category_id = p.category_id")
            ->where(getWhereSqlByMap($map))
            ->count();

        return $count;
    }

}

